package personnel.department.utils;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;

import org.apache.commons.lang3.CharSet;

import com.google.common.base.Charsets;

public class ExportUtils {

	public static void toCSV(String fileName, String data) throws IOException {
		if (fileName == null) {
			return;
		}
		File file = new File(fileName);
		if (!file.exists()) {
			file.createNewFile();
		}
		FileOutputStream fileOutputStream = new FileOutputStream(file);
		fileOutputStream.write(data.getBytes(Charset.forName("windows-1251")));
		fileOutputStream.close();
	}
	
}
